#include <stdio.h>

int gcd_1(int a, int b)
{
    if (b == 0)
        return a;
    return gcd_1(b, a%b);
}

int gcd_2(int a, int b)
{
    int r;
    while (b != 0)
    {
        r = a%b;
        a = b;
        b = r;
    }

    return a;
}

int main(int argc, char const* argv[])
{
    printf("%d\n", gcd_1(2842, 56));    
    printf("%d\n", gcd_2(2842, 56));    
    return 0;
}
